<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [11,9,17,22,33]
        // 升序
        var arr1 = arr.sort(function(a,b){
            return a - b
        })
        //降序
        var arr2 = [11,9,17,22,33] 
        var arr3 = arr2.sort(function(a,b){
            return b - a
        })
        console.log(arr1,arr3)
    </script>
</body>
</html>